import { request } from "../request";

const token = localStorage.getItem("token");

/**
 * 批量删除用户接口返回结构
 */
export interface BatchDeleteUsersRes {
    code: number;
    message: string;
    data: string;
    timestamp: Record<string, unknown>;
}

/**
 * 批量删除用户
 * @param params 用户ID数组
 * @returns 删除结果
 */
export const batchDeleteUsersAPI = async (params: number[]): Promise<BatchDeleteUsersRes> => {
    return request(`/api/users/batch`, {
        method: "delete",
        headers: {
            Authorization: `Bearer ${token}`,
            "Content-Type": "application/json"
        },
        data: JSON.stringify(params)
    });
};